#ifndef OOPSMP_UTILS_GEOMETRY_JOINTS_JOINTS3DPRISMATIC_H_
#define OOPSMP_UTILS_GEOMETRY_JOINTS_JOINTS3DPRISMATIC_H_

#include "OOPSMP/Utils/Geometry/Joints/Joints3D.h"

namespace OOPSMP {
	
	/**
	 *@brief Macro for class, class pointer, and const class pointer
	 *       declarations 
	 */
	ForwardClassDeclaration(Joint3DPrismatic);
	
	/**
	 *@brief joint 3d prismatic
	 */ 
	class Joint3DPrismatic : public Joints3D {
		
	public:
		
		/**
		 *@brief Default constructor
		 */
		Joint3DPrismatic() {
			jointLimitsMin = new double[1];
			jointLimitsMax = new double[1];
		}
		
		/**
		 *@brief Default destructor
		 */
		~Joint3DPrismatic() {
			delete [] jointLimitsMin;
			delete [] jointLimitsMax;
		}
		
		/**
		 *@brief Sets joint range of values
		 *@param min array of minimum values
		 *@param max array of maximum values
		 */
		void setJointLimits( const double * min, const double * max ) {
			jointLimitsMin[0] = min[0];
			jointLimitsMax[0] = max[0];
		}
		
		/**
		 *@brief Returns joint range of values
		 *@param min empty array for minimum values
		 *@param max empty array for maximum values
		 */
		void getJointLimits( double * min, double * max ) const {
			min[0] = jointLimitsMin[0];
			max[0] = jointLimitsMax[0];
		}
		
		/**
		 *@brief Returns number of degrees of freedom for joint
		 */
		int getNumDoFs() const { return 1; }
		
		/**
		 *@brief Returns true iff degree of freedom represents angle
		 *@param dof_id index of degree of freedom in this joint
		 */
		bool isDoFAngle( int dof_id ) const { return false; }

		/**
		 *@brief Returns transformation between two robot links
		 *@param link1_dims dimensions of link we transform from
		 *@param link2_dims dimensions of link we transform to
		 *@values values of dofs for joint connecting links
		 *@param result empty array to contain transformation
		 */
		void getTransformationMatrix( double *link1_dims, double *link2_dims, const double * values , double * result ) const
		{	
			double x = values[0];
			toMatrix(0, 0, 0, x, 0, 0, link1_dims, link2_dims, result);
		}

	};

	/**
     *@brief Declare factory and specify in source file the functions that should
     *       be registered for plug-and-play functionality
     */
	DeclareInstanceFactory(Joint3DPrismatic, Joints3DFactory);

}

#endif